﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OracleClient;
using BCNPCObject.DB;
using DbLinq;
using DbLinq.Oracle;
using CMISLibrary.Entities;
using CMISLibrary;


namespace BCNPCObject.EXCEL
{
    public class cls_CN_HDON_GTHU_Controller
    {
        #region   Atributes

        //private DataSet CMIS_Header = new CMISOutputParameter();
        private CN_HDON_GTHU info;

        #endregion

        #region   Constructor

        public cls_CN_HDON_GTHU_Controller()
        {
            info = new CN_HDON_GTHU();
        }
        public cls_CN_HDON_GTHU_Controller(CN_HDON_GTHU Info)
        {
            this.info = Info;
        }

        #endregion

        #region   Properties

        public CN_HDON_GTHU pInfor
        {
            get { return info; }
            set { info = value; }
        }
        #endregion
        #region Methods
        public DataSet select_CN_HDON_GTHU(string ma_dviqly,List<Int64> Intlist)
        {
            DataTable dt = new DataTable();
            DataSet ds = new DataSet();
            try
            {
                var result = from a in CMIS2.DB.CN_HDON_GTHU.ToList()
                             where a.MA_DVIQLY == ma_dviqly && Intlist.Contains(a.SO_BBGIAO) && a.SO_BBQTOAN == 0
                             select a;
                    dt = Utility.LINQToDataTable(result);
                    ds.Tables.Add(dt);
                    return ds;
            }
            catch (Exception ex)
            {
                //maloi = ex.ToString();
                CMIS2.ResetDB(); return null;
            }
        }
        #endregion
    }
}

